<?php

namespace app\admin\model\dahui;

use think\Model;

class Zfbt extends Model
{
    // 表名
    protected $name = 'dahui_zfbt';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [
        'refundornot_text',
        'tbstate_text'
    ];
    

    
    public function getRefundornotList()
    {
        return ['已退款' => __('已退款'),'待退款' => __('待退款'),'' => __('')];
    }     

    public function getTbstateList()
    {
        return ['' => __(''),'重复' => __('重复')];
    }     


    public function getRefundornotTextAttr($value, $data)
    {        
        $value = $value ? $value : (isset($data['refundornot']) ? $data['refundornot'] : '');
        $list = $this->getRefundornotList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getTbstateTextAttr($value, $data)
    {        
        $value = $value ? $value : (isset($data['tbstate']) ? $data['tbstate'] : '');
        $list = $this->getTbstateList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
